package com.pureut.retrospect.controller;

import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.common.core.web.page.TableDataInfo;
import com.pureut.common.security.annotation.RequiresPermissions;
import com.pureut.retrospect.domain.dto.RetrospectManageDto;
import com.pureut.retrospect.service.MaterialTraceabilityService;
import com.pureut.system.api.vo.WmsStockInfoVo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: YSL
 * @Date: 2023/4/11 9:59
 * @Desc: 物料追溯
 */
@RestController
@RequestMapping("/materialTraceability")
public class MaterialTraceabilityController extends BaseController {

    @Resource
    private MaterialTraceabilityService materialTraceabilityService;

    /**
     * 基础信息
     * @param wsiCategory, wsiMaterialNumber
     * @return
     */
    @GetMapping("/getRetrospectManageList")
    public AjaxResult getRetrospectManageList(Long wsiCategory, String wsiMaterialNumber) {
        return AjaxResult.success(materialTraceabilityService.getFoundationList(wsiCategory, wsiMaterialNumber));
    }

    /**
     * 物料履历
     * @param
     * @return
     */
    @GetMapping("/MaterialResumeList")
    public AjaxResult MaterialResumeList(Long wsiCategory, String wsiMaterialNumber) {
        return AjaxResult.success(materialTraceabilityService.MaterialResumeList(wsiCategory, wsiMaterialNumber));
    }


    /**
     * 品检信息
     * @param wsiMaterialNumber
     * @return
     */
    @GetMapping("/getQualityTemporaryList")
    public AjaxResult getQualityTemporaryList(String wsiMaterialNumber) {
        return AjaxResult.success(materialTraceabilityService.getQualityTemporaryList(wsiMaterialNumber));
    }

    /**
     * 同批次信息
     * @param wsiMaterialNumber
     * @return
     */
    @GetMapping("/getSameBatchList")
    public AjaxResult getSameBatchList(String wsiMaterialNumber) {
        return AjaxResult.success(materialTraceabilityService.getSameBatchList(wsiMaterialNumber));
    }


}
